<?php

require_once 'udper.php';

$udper = new Udper();
log_trace( 'listening ...' );

$udper->listen();

log_trace( 'recving ...' );
$ip='';
$port=0;
$data = $udper->recv(10, $ip, $port);
if ( empty($data) ) {
    log_trace( 'got nothing' );
    exit( 1 );
}
log_trace( "get from '$ip:$port' : $data" );

log_trace( sprintf("sending to '%s:%s' : $data ...", $ip, $port, $data) );
$udper->send($data, 10, $ip, $port);

log_trace( 'done.' );

?>

